﻿@model IEnumerable<RedSand.Site.Models.RequestInfoFull>
@if (Model != null)
{
    <!-- list content -->
    <div class="list-panel-cotent-item-need">
        @foreach (var item in Model)
        {
            <div id="content-item-ineed-@item.StartId" class="panel-content-item-ineed">
                <div class="head-content-item-ineed clearfix">
                    <img src="@item.Avatar.GetImageUrl(1)" class="avt fl" />
                    <div class="title">
                        @item.Title</div>
                    <span class="poster">@Html.Translate("UserName", "News") : @item.UserName</span>
                    <span class="post-date">@item.CreateDate.GetDate()</span> <span class="post-status">@Html.Translate("Status")
                        : @RedSand.Site.DropDownListHelper.GetStatusRequestString(@item.Status) </span>
                </div>
                <div class="main-content-item-ineed">
                    @item.Content
                </div>
                <div class="list-reply-item-ineed">
                    @Html.Action("ListReply", "Reply", new { RequestId = item.RequestID })
                    @if (User.Identity.IsAuthenticated)
                    {
                        if (item.UserName == User.Identity.Name)
                        {
                        <div class="panel-reply-item-ineed clearfix">
                            <input type="text" name="content" maxlength="120" id="txt_comment" />
                            <input type="submit" value="@Html.Translate("Request")" class="submit_comment" />
                        </div>
                        }
                    }
                </div>
            </div>
        }
    </div>
    <!-- list preview -->
    <div class="list-item-ineed">
        @foreach (var item in Model)
        {
            <a href="@item.RequestID" class="item-ineed clearfix" title="content-item-ineed-@item.StartId">
                <img class="avt" src="@item.Avatar.GetImageUrl(1)" />
                <h5>
                    @item.Title
                </h5>
                <p class="description">
                    @item.Content.SubStringExtended(0, 140)
                    <br />
                    <span class="poster">@Html.Translate("UserName", "News") : @item.UserName</span>
                    <span class="post-date">@item.CreateDate.GetDate()</span><span class="post-status">
                        @Html.Translate("Status") : @RedSand.Site.DropDownListHelper.GetStatusRequestString(@item.Status)</span>
                </p>
            </a>
        }
    </div>
    <div class="script-select-item">
        <script type="text/javascript" language="javascript">
            $(document).ready(function () {
                // action select item i need
                $(ObjectIneed.TagItemIneed).click(function (event) {
                    $(ObjectIneed.TagDescriptionItemIneed).show();
                    $(ObjectIneed.TagCloseDesriptionItemIneed).show();
                    $(ObjectIneed.TagListContentItem).show();
                    $(ObjectIneed.TagContentItemDisplayActive).removeClass(ObjectIneed.ClassContentItemDisplayActive);
                    $('#' + $(this).attr("title")).addClass(ObjectIneed.ClassContentItemDisplayActive);
                    fleXenv.fleXcrollMain($(this).attr("title"));
                    return false;
                })
            })
        </script>
    </div>
}
